home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / games / _corewar / _help < prev    next >
Encoding:
Text File  |  1991-04-07  |  14.5 KB  |  385 lines

  1. !Help for !CoreWar Version 7.01
  2. -------------------------------
  3.  
  4. *** Compliant to the May 1986 International ***
  5. ***     Core Wars Society specification     ***
  6.  
  7. [Docs as of 7-Apr-91]
  8.  
  9. Files included in this package :-
  10.  
  11.   !Run
  12.   !RunImage
  13.   !Sprites
  14.   Sprites
  15.   !Help
  16.   Templates
  17.   code
  18.   ArmCode
  19.   chkspr    ) my chkspr util, rename the app and see what
  20.   !Boot     ) happens (nothing!). Notes in Comments.
  21.  
  22. and a directory 'Source' with lots of files!
  23.  
  24.   The Core War is a game originally devised by A.K. Dewdney
  25. and published in the 'Computer Recreations' column of the
  26. May 1984 Scientific American. This application provides a
  27. multi-tasking version of the game along with an intergrated
  28. stand alone version that runs somewhat quicker!
  29.  
  30.  
  31. Usage
  32. -----
  33.  
  34.   For instructions on how to play the game I advise you to
  35. get a copy of the BBC Acorn User May 1991 editon, which
  36. gives a gentle tutorial into the corewar (I would include
  37. it verbatim, but it is their copyright now!) however if you
  38. can't/don't get a copy the appendix provides some
  39. introductory notes.
  40.  
  41.   You should be able to use the actual application without
  42. any documentation, so long as you know redcode!, since I
  43. have tried to make the user interface completely common
  44. sense - well it is to me anyway, all the same ...
  45.  
  46.   To commence a battle simply drop two battle programs onto
  47. the corewar iconbar sprite. A battle program can either be
  48. a text file with 'redcode' source or an object code file
  49. with filetype 'data' or 'corewar'. The advantage of the
  50. object code is that there is no time wait for assembly
  51. (even though the machine multi-tasks during assembly which
  52. is normally less that thirty seconds), you can double click
  53. (corewar files) to load them and more importantly you can
  54. post your programs to your friends in a form that is much
  55. harder for them to crack and copy your ideas! (for an
  56. appropriate sum I can provide you with my dissasembler
  57. ...). I suggest you create a directory 'Object' and place
  58. all the object code versions of you programs in there,
  59. otherwise it can be all to easy to overwrite your source -
  60. not such a good idea!.
  61.  
  62.   Once two battle programs have been dropped on the iconbar
  63. sprite then clicking on 'Commence Battle' will do just
  64. that! A battle screen opens with the names of the opponents
  65. in their appropriate colours and assosiated number of tasks
  66. running. You can run the Core War as a full screen version
  67. (reeping the signifcant speed benefits) by choosing the
  68. 'Single Task' option in the iconbar menu. <Escape> will
  69. return to the desktop and the Core War will continue
  70. playing in a window.
  71.  
  72.   Clicking on the quit icon on the battle screen removes it
  73. from sight and significantly increases the speed of the
  74. simulation (in mode 12 this can approach the stand alone
  75. speed when maximum speed is selected), clicking on the
  76. iconbar sprite will reopen the battle screen.
  77.  
  78. Hopefully the appearance and dissapearance of the dialogues
  79. and windows should be fairly intuative (ie Adjust clicks
  80. work) - if you don't think so then tell me and I will fix
  81. it!
  82.  
  83. Menu Choices
  84. ------------
  85.  
  86.  
  87. Info        : As per usual!
  88.  
  89. Pause/      : Pauses the game     } one or the other displayed
  90. Continue      Continues the game  } at any one time!
  91.  
  92. Stop        : The battle is teminated, can NOT be continued.
  93.               This option returns any surplus memory to the
  94.               system.
  95.  
  96. Show Screen : Opens the battle screen.
  97.  
  98. Cycles      : Sets the number of locations executed before
  99.               returning to the WIMP.
  100.               min is 1,max is 150 and < 15 is very responsive.
  101.  
  102. Single Task : If ticked then the full screen 625 cps
  103.               version of the CoreWar will be used. All
  104.               tasks are suspended during the battle.
  105.               If chosen while a battle is in progress then
  106.               the application will go into full screen
  107.               mode. As normal <Escape> returns to the desktop.
  108.  
  109. Save Code   : If ticked a save window will pop up instead
  110.               allowing saving of the assembled code.
  111.  
  112. Quit        : You've guessed it!
  113.  
  114.  
  115. System Variables
  116. ----------------
  117.  
  118.   There are a few features of the application that you can
  119. configure with system variables, if you input stupid
  120. things/nothing the the application will adopt the indicated
  121. defaults (they are pretty good starting points) :-
  122.  
  123. CoreWar$Cycles XXX       : This sets the default parameter
  124.                            'cycles' as in the menu. Default
  125.                            is 10.
  126.  
  127. CoreWar$SaveAssembly y/n : This sets the 'Save Code'
  128.                            option. Default is n. 
  129.  
  130. CoreWar$SingleTask   y/n : This sets the 'Single Task'
  131.                            option. Default is n.
  132.  
  133.  
  134. Appendix
  135. --------
  136.  
  137. A VERY Rudimentary Introduction to the Core War
  138. -----------------------------------------------
  139.  
  140.   The 'Core War' is a game played within a simulated
  141. computer using a language called 'Redcode' which is much
  142. like the 6502 assembly language of the BBC micro. Two
  143. programs are placed randomly in the memory array (which is
  144. accessed through a modulo statement so if a location is
  145. required that is bigger than the array size then the
  146. address 'wraps' around) and then left to run, being
  147. supervised by the executive program which simulates a
  148. multi-tasking operating system. The idea of the game is to
  149. 'kill' the other program by making it execute a
  150. non-executable instruction!
  151.  
  152.   The simplest RedCode program is Imp, MOV 0 1. It copies
  153. itself one location forward, the very location to next be
  154. executed. Hence Imp trails all the way through the core one
  155. loaction at a time.
  156.  
  157.   The following programs are examples of the Redcode
  158. assembly language that the !CoreWar application uses (the
  159. command set is included below). The '.' followed by a
  160. number is a label much like Basic assembler labels but only
  161. numbers are allowed. This program is called Dwarf.
  162.  
  163.        JMP  .0
  164.     .1 DAT  -1      
  165.     .0 MOV  .1 @.1
  166.        ADD # 5  .1
  167.        JMP  .0 
  168.  
  169.   The program simply pokes the number 0 in every fifth
  170. location in the memory array. The 'JMP .0' skips the
  171. non-executable data statement at '.1'. 'MOV .1 @.1' puts
  172. 'DAT x' in the memory location pointed to by the value
  173. stored at x (where x is the data stored in the DAT
  174. location). 'ADD #5  .1' increments the data stored at .1 by
  175. 5 and 'JMP .0' returns the PC to the beginning of the loop.
  176.  
  177.   A more interesting example is a self-copying program.
  178. This example copies itself 100 locations forward and then
  179. executes from there. It is called Gemini.
  180.  
  181. JMP .2
  182. .0 DAT  5
  183. .2 MOV #5   .0
  184.    MOV #100 .1
  185. .3 MOV @.0 <.1 
  186.    DJN  .3  .0
  187.    JMP @.1
  188. .1 DAT  100
  189.  
  190.   The only new feature in this code is the use of the
  191. auto-decrement indirect addessing mode, '<'. With this
  192. addressing mode the location specified is decremented and
  193. then treated as if it had been specified with a '@'. The
  194. entire reason for this mode is to speed up coping of code
  195. to encouage interesting programs.
  196.  
  197.   That assembler allows up to 40 lables and about 250
  198. generated lines of object code. The assembler is not case
  199. sensitive and comments are added by using the \ character.
  200.  
  201.  
  202. Table of valid redcode menonics :-
  203.  
  204.  Mnemonic   Args                 Function
  205. +-------------------------------------------------------------+
  206. |        |        |                                           |
  207. |  DAT   |  -  B  |    B is a data value. Non executable      | 
  208. |        |        |                                           |
  209. |  MOV   |  A  B  |    Copy the contents of A to the          |
  210. |        |        |    contents of B                          |
  211. |        |        |                                           |
  212. |  ADD   |  A  B  |    Add the contents of A to the           |
  213. |        |        |    contents of B                          |
  214. |        |        |                                           |
  215. |  SUB   |  A  B  |    Subtract the contents of A from        |
  216. |        |        |    the contents of B                      |
  217. |        |        |                                           |
  218. |  JMP   |  A  -  |    Jump to statement at A                 |
  219. |        |        |                                           |
  220. |  JMZ   |  A  B  |    If the contents of B is zero, jump     |
  221. |        |        |    to A                                   |
  222. |        |        |                                           |
  223. |  JMN   |  A  B  |    If the contents of B is not zero,      |
  224. |        |        |    jump to A                              |
  225. |        |        |                                           |
  226. |  DJN   |  A  B  |    Decrement the contents of B. If        |
  227. |        |        |    the contents of B is not zero,         |
  228. |        |        |    jump to A                              |
  229. |        |        |                                           |
  230. |  CMP   |  A  B  |    Compare the contents of A with         |
  231. |        |        |    the contents of B. If they are         |
  232. |        |        |    equal skip the next instruction        |
  233. |        |        |                                           |
  234. |  SPL   |  A  -  |    Spilt the exection to the next         |
  235. |        |        |    statement and the one at A             |
  236. |        |        |                                           |
  237. +-------------------------------------------------------------+
  238.  
  239. and addresssing modes :-
  240.  
  241.   Type   Prefix            Definition                                   
  242. +-------------------------------------------------------------+
  243. |         |      |                                            |
  244. |Immediate|   #  | Val specified used                         |
  245. |         |      |                                            | 
  246. |Relative | none | Val specified acts relative to PC          |
  247. |         |      |                                            |
  248. |Indirect |   @  | Val specified points relatively to the     |
  249. |         |      | val to be used (acting relative to its     |
  250. |         |      | loc in mem, not the P.C.'s)                |
  251. |         |      |                                            |
  252. |Auto-    |      | As indirect by the location is decremented | 
  253. |Decrement|   <  | by one before calculating the resultant    |
  254. |Indirect |      | location                                   |
  255. |         |      |                                            |
  256. +-------------------------------------------------------------+        
  257.  
  258.  
  259.  For those in the know the core size is 8000 locations -
  260. this is hardwired into the code for speed - sorry - if you
  261. want something different please get in contact with me & I
  262. will provide you with another 'ArmCode' file.
  263.  
  264.  
  265. Versions
  266. --------
  267.  
  268. 1.xx  : The inital BBC versions (no graphics!)
  269. 2.xx  : The BBC teletext graphics versions (BAU published
  270.         one of these!)
  271. 3.xx  : The inital Master 128 versions
  272. 4.xx  : The inital Archimedes versions
  273. 5.xx  : The corewar converted to 'C'
  274. 6.xx  : The ARM code versions of the CoreWar
  275.  
  276. and after all that - and a good three years - we have the
  277. one and only brand spanking new, heavily re-coded ...
  278.  
  279. 7.00  : The first release of the multi-tasking version.
  280.         Fully featured with a built in assembler, stand
  281.         alone battle version and, I would guess the world's
  282.         first, multi-tasking battle version.
  283.  
  284. 7.01  : Full screen/Window toggle rather than one or the
  285.         other. Having written 7.00 I started to develop
  286.         some battle progs and decided that this was
  287.         required. Also including various tidy ups, merging
  288.         of the wimp and stand alone code and, par for the
  289.         course, bug fixes!
  290.  
  291. Comments
  292. --------
  293.  
  294.   This is my biggest application so far. The depressing
  295. thing is the basic version is about 3k long! (small fib
  296. there seeing it doesn't have an assembler and I didn't
  297. count the variable store but even so!). The 96k slot is
  298. deceptive, the program can require up to 192k but you will
  299. only ever notice the slot going up to 144k, the 48k
  300. required to store 8000 core locations of 5 bytes each. The
  301. extra 48k is used to convert between the full screen and
  302. the battle screen window since the screen needs to be saved
  303. as a sprite and then plotted onto the battle screen sprite
  304. with a scale factor (WOW, isn't RISC OS easy to use!). So
  305. be careful otherwise the game will refuse to do things. Oh
  306. yes, on assembly the game slots an extra 1.5 times the size
  307. of the source code.
  308.  
  309.  
  310.   The ChkSpr Utility
  311.  
  312.   The chkspr utility will, when run, examine the '!Sprites'
  313. file and check if the first sprite is the application's
  314. name. If not that sprite's name will be changed to the
  315. application directory's name. The !Boot file contains
  316. 'Run ChkSpr', this runs the util, the next line contains
  317. 'IconSprites <Obey$Dir>.!Sprites' this loads the new sprite
  318. in. The filer always calls any new (ie renamed) app's !Boot
  319. file so the new sprite is automatically loaded for display.
  320.  
  321. Please feel free to use the utility separately from the
  322. rest of the package but note that the conditions set out
  323. below apply to it.
  324.       
  325.  
  326. Conditions of Use
  327. -----------------
  328.  
  329.   This application is supplied free to everyone 'as is', I
  330. do not give any guarantee that it is free of bugs, or
  331. supply any warranty about its suitabliliy for use. However
  332. if there are any problems with it and you notify me of them
  333. then I probably will do my best to recify them.
  334.  
  335.   You may give this application to anyone, via any medium,
  336. so long as :- 
  337.  
  338.   1) It is delivered with ALL the supplied files and
  339.      unaltered (except !Run & !Boot files).
  340.  
  341.   2) It is not supplied on a disc you are charging
  342.      for (except for media and postage costs).
  343.   
  344.   You have permission to use any part or the whole
  345. application in a project you intend to place in the public
  346. domain, as long as I am fully credited. If you wish to use
  347. any part or the whole of this application in a product that
  348. you wish to sell (for however much and for whatever
  349. reasons) or release as copyright material then my express
  350. permission in writing must be obtained. I maintain
  351. copyright on all the material supplied and reserve the
  352. right to amend these conditions in cases where I deem
  353. misuse.
  354.  
  355.    A large number of hours of work have gone into the
  356. production and maintenance of this application and although
  357. I have supplied the application free, donations will be
  358. gratefully received (and if over 7 pounds I will send you a
  359. disc with updates of this and all other pd stuff I have
  360. written. Please include a letter telling me which apps of
  361. mine you use and their version numbers).
  362.  
  363.  
  364. Contacts
  365. --------
  366.  
  367. My address:
  368.  
  369.   6 Parklands Place,
  370.   Guildford,
  371.   Surrey GU1 2PS.
  372.  
  373. BBSs I call frequently:
  374.  
  375.   Archive BBS          [0603 745932]   mbx 23
  376.   Arcade BBS           [01 654 2212]   mbx 23
  377.   The World of Cryton  [0749 679794]   mbx 273
  378.  
  379. email : maurp@uk.ac.warwick.cu
  380.  
  381. (try email during term time if you want a quick reply and
  382. an even quicker update!)
  383.  
  384. © Emmet Spier 1991 - USE and Enjoy!
  385.